package com.woniuxy.controller;

import com.woniuxy.entity.ResponseEntity;
import com.woniuxy.entity.Skill;
import com.woniuxy.service.SkillService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName SkillController
 * @Description TODO
 * @Author 冯浩波
 * @Date 2022/3/8 16:32
 */

@RestController
@RequestMapping("/skill")
public class SkillController {
    @Autowired(required = false)
    SkillService skillService;

    //添加能力
    @ApiOperation(value = "添加能力")
    @RequestMapping("/addSkill")
    public ResponseEntity addSkill (@RequestBody Skill skill){
        return skillService.addSkill(skill);
    }

    //修改能力
    @ApiOperation(value = "修改试题")
    @RequestMapping("/updateSkill")
    public ResponseEntity updateSkill(@RequestBody Skill skill){
        return skillService.updataSkill(skill);
    }

    //查询能力
    @ApiOperation(value = "查询试题")
    @RequestMapping("/findSkill/{id}")
    public ResponseEntity findSkill(@PathVariable int id){
        return skillService.findSkill(id);
    }
}
